package com.google.gwt.sample.dynatablerf.server.util;

import org.apache.commons.codec.binary.Base64;

public class ConvertUtil {

	public static String convertToBase64(byte[] byteArray) {
		StringBuilder imageDataAsbase64String = new StringBuilder();
		String encodedString = new String(Base64.encodeBase64(byteArray));

		imageDataAsbase64String.append("data:image/jpg;base64,");

		imageDataAsbase64String.append(encodedString);

		return imageDataAsbase64String.toString();
	}
}
